SET LIGHT TO OBJECT ORIENTATION

This command will rotate an existing light to the orientation of another object.

  Syntax
SET LIGHT TO OBJECT ORIENTATION Light Number, Object Number
  Parameters
Light Number
Integer
The light number
Object Number
Integer
The object number

  Returns

This command does not return a value.

  Description

To create the effect of headlamps, two spotlights would each take the rotational orientation of a car. The parameters must be specified using integer values.

  Example Code
sync on
autocam off
color backdrop rgb(0,0,0)
load image "ground.jpg",1
make matrix 1,1000,1000,100,100
prepare matrix texture 1,1,1,1
position matrix 1,-500,0,-500
position camera 0,100,0
make object sphere 1,20
position object 1,0,0,500
set ambient light 20
color ambient light rgb(64,64,128)
set normalization off
set point light 0,0,0,500
position light 0,0,100,0
color light 0,512,512,255
set light range 0,1000
make light 1
set spot light 1,45,90
color light 1,512,100,100
position light 1,0,50,400
set light range 1,500
while inkey$()<>"x"
set light to object orientation 1,1
set light to object position 1,1
a#=a#+1
if a#>359 then a#=a#-360
rotate light 1,0,a#,0
sync
endwhile
delete light 1
delete object 1
set normalization on
end
  See also

LIGHT Commands Menu
Index